Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inference of max_values(::Union) #40785

Merged
merged 1 commit into from
May 11, 2021
Merged

Conversation

odow
Copy link
Contributor

@odow odow commented May 11, 2021

This is a cause of method invalidation in JuMP.

It gets called when constructing a dictionary:

newsz = min(newsz, max_values(T)::Int)

But during Pkg operations, it gets called as:

julia> @code_warntype Base.max_values(Union{Nothing,VersionNumber})
Variables
  #self#::Core.Const(Base.max_values)
  T::Type{Union{Nothing, VersionNumber}}

Body::Any
1%1  = Base.getproperty(T, :a)::Any%2  = Base.max_values(%1)::Any%3  = Base.getproperty(T, :b)::Any%4  = Base.max_values(%3)::Any%5  = Base.getproperty(T, :a)::Any%6  = Base.max_values(%5)::Any%7  = Base.getproperty(T, :b)::Any%8  = Base.max_values(%7)::Any%9  = (%6 + %8)::Any%10 = Base.max(%2, %4, %9)::Any
└──       return %10

@KristofferC KristofferC added the backport 1.6 Change should be backported to release-1.6 label May 11, 2021
@KristofferC KristofferC merged commit 0105fe4 into JuliaLang:master May 11, 2021
KristofferC pushed a commit that referenced this pull request May 11, 2021
@KristofferC KristofferC mentioned this pull request May 11, 2021
45 tasks
KristofferC pushed a commit that referenced this pull request May 11, 2021
@odow odow deleted the patch-1 branch May 11, 2021 20:23
shirodkara pushed a commit to shirodkara/julia that referenced this pull request Jun 9, 2021
johanmon pushed a commit to johanmon/julia that referenced this pull request Jul 5, 2021
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Jul 12, 2021
staticfloat pushed a commit that referenced this pull request Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants